package com.swallow.auth.infrastructure.convert.dept;

import com.swallow.auth.application.bo.dept.DeptQryRetBO;
import com.swallow.auth.domain.dept.model.entity.DeptEntity;
import com.swallow.auth.infrastructure.mysql.po.DepartmentPO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author: 18310740596@163.com
 * @date: 2024-05-20 23:09:19
 * @version: v1.0
 * @describe: class responsibility
 */
@Mapper
public interface CvtDeptRepositoryMapper {
    CvtDeptRepositoryMapper INSTANCE = Mappers.getMapper(CvtDeptRepositoryMapper.class);

    @Mappings({
            @Mapping(source = "level", target = "deptLevel")
    })
    DepartmentPO deptEntity2PO(DeptEntity entity);

    @Mappings({
            @Mapping(source = "parentDeptNo", target = "parentNo")
    })
    DeptQryRetBO deptPO2BO(DepartmentPO department);
}
